import pytest
import yaml

from cal.calc import Calc

# class TestFixture:
#     @pytest.fixture(scope="module") #这个位置是作用域function是否能够能够被查询到
#     def add_datas(self):
#         with open("./data.yml") as f:
#             self.add = yaml.safe_load("add")
#             self.add_datas1 = self.add("datas")
#             self.add_name = self.add("name")
#         return self.add_datas1, self.add_name
#
#
#     @pytest.fixture(scope="module")
#     def div_datas(self):
#         with open("./data.yml") as f:
#             div = yaml.safe_load("div")
#             div_data = div("datas")
#             div_name = div("name")
#         return div_data, div_name

    #
    # @pytest.fixture(scope="module")
    # def test_calc():
    #     calc = Calc()
    #     return calc

@pytest.fixture()
def test_calc1():
    print("计算开始")
    yield
    print("计算结束")